package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class BindPhoneMethods extends BaseMethods {

    private static BindPhoneMethods m_ins = null;

    public static BindPhoneMethods getInstance() {
        if (m_ins == null) {
            synchronized (BindPhoneMethods.class) {
                if (m_ins == null) {
                    m_ins = new BindPhoneMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "User/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void mobileBind(Subscriber<Object> subscriber,
                      int uid,String hashid , String mobile ,String checkcode) {
        Observable observable = initService().mobileBind(System.currentTimeMillis()+"",
                "6f764b5bc22837c829ce9b406a830ef1",uid,mobile,checkcode
        );
        toSubscribe(observable, subscriber);
    }
}
